package com.cmdi.mq.controller;

import com.cmdi.mq.domain.R;
import com.cmdi.mq.domain.SysUserLog;
import com.cmdi.mq.service.SysUserLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: SysLogController
 * @Author: gaozb
 * @Date: 2021/9/9$ 16:50$
 * @Version: 1.0
 */
@Slf4j
@RestController
@Api(tags = "日志管理")
public class SysLogController {
    @Autowired
    private SysUserLogService sysUserLogService;

    @PostMapping("/log/save")
    @ApiOperation("保存日志")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sysUserLog", value = "日志类")
    })
    public R<Boolean> logSave(@Validated @RequestBody SysUserLog sysUserLog) {
        log.info("正在将当前操作入库");
        boolean save = sysUserLogService.save(sysUserLog);
        return R.ok(true);
    }
}